﻿<%@ Page Title="Central Store Administration" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" MaintainScrollPositionOnPostback="true" CodeBehind="RequisitionStoreManager.aspx.cs" Inherits="KorleBu.RequisitionStoreManager" %>

<%@ Register TagPrefix="asp" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 273px;
        }

        .style2
        {
        }

        .style11
        {
            width: 220px;
        }

        .style13
        {
            width: 99px;
        }

        .style14
        {
            width: 170px;
        }

        .style15
        {
            width: 140px;
        }

        .style16
        {
            width: 130px;
        }

        .style17
        {
            width: 103px;
        }

        .style23
        {
            width: 194px;
        }

        .style25
        {
            width: 108px;
        }

        .style26
        {
            height: 25px;
        }

        .style27
        {
            width: 193px;
        }

        .style28
        {
            width: 173px;
        }

        .style29
        {
            width: 178px;
        }
    </style>
    <script type="text/javascript">
        function CEO_NewWindow() {
            var ceo = window.open('CEOSignOff.aspx', '_blank', 'width=760,height=900,resizable=1,scrollbars=1');
            ceo.focus();
        }
    </script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="sidebarcontentplaceholder" runat="server">
    <p>
        <br />
        <asp:Label ID="lblLoggedInUser" runat="server" Font-Bold="true" Visible="true" />
    </p>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="maincontentplaceholder" runat="server">
    <asp:ScriptManager ID="ScriptManager" runat="server" />
    <asp:UpdatePanel ID="UpdatePanel" runat="server">
        <ContentTemplate>
            <div id="ebar">
                <asp:Label runat="server" ID="lblMasterError" CssClass="errorLabel" />
            </div>
            <asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0"
                Width="100%" AutoPostBack="True"
                OnActiveTabChanged="TabContainer1_ActiveTabChanged">
                <asp:TabPanel ID="ViewRequisitions" Width="100%" runat="server" HeaderText="TabPanel1">
                    <HeaderTemplate>View Requisitions</HeaderTemplate>
                    <ContentTemplate>

                        <asp:MultiView ID="mvViewRequisition" runat="server" ActiveViewIndex="0">
                            <asp:View ID="vSelectRequisition" runat="server">
                                <asp:GridView ID="gvViewRequisition" runat="server" AutoGenerateColumns="False"
                                    OnRowCommand="gvViewRequisition_RowCommand">
                                    <RowStyle HorizontalAlign="Right" VerticalAlign="Middle" />
                                    <Columns>
                                        <asp:BoundField DataField="RequisitionID" HeaderText="ID" />
                                        <asp:BoundField DataField="RequisitionName" HeaderText="Name" />
                                        <asp:BoundField DataField="orderDate" HeaderText="Date" />
                                        <asp:BoundField DataField="StoreID" HeaderText="Store ID" Visible="False" />
                                        <asp:TemplateField HeaderText="Status">
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblStatusName" Text='<%# Bind("StatusName") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:CommandField ButtonType="Button" ShowSelectButton="True" />
                                    </Columns>
                                </asp:GridView>
                                <br />
                                <asp:Label ID="lblMissingRequisition" runat="server" ForeColor="Red"></asp:Label>
                            </asp:View>
                            <asp:View ID="vViewRequisitionItems" runat="server">
                                <table id="CreateRequest">
                                    <tr>
                                        <td class="style16" style="border-width: thin; border-style: solid; border-color: Black;">
                                            <strong>ID:</strong>
                                            <asp:Label ID="lblViewRequisitionID" runat="server"></asp:Label>
                                        </td>
                                        <td class="style15" style="border-width: thin; border-style: solid; border-color: Black;">
                                            <strong>Date:</strong>
                                            <asp:Label ID="lblViewRequisitionDate" runat="server"></asp:Label>
                                        </td>
                                        <td style="border-width: thin; border-style: solid; border-color: Black;">
                                            <strong>Status:</strong>
                                            <asp:Label ID="lblViewStatus" runat="server"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="3" style="border-width: thin; border-style: solid; border-color: Black;">
                                            <strong>Description:</strong>
                                            <asp:Label ID="lblViewDescription" runat="server"></asp:Label>
                                        </td>
                                    </tr
                                    <tr>
                                        <td colspan="3" style="border-width:thin; border-style:solid; border-color:Black;">
                                            <strong>Comments:</strong>
                                            <asp:Label ID="lblComments" runat="server"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style1" colspan="3">
                                            <asp:Button ID="btnSelectNewRequisition" runat="server"
                                                OnClick="btnSelectNewRequisition_Click" Text="Select New Requisition"
                                                CausesValidation="False" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="style1" colspan="3">
                                            <asp:Button ID="btnHideRequisition" runat="server"
                                                OnClick="btnHideRequisition_Click" Text="Hide This Requisition"
                                                CausesValidation="False" Visible="false"/>
                                        </td>
                                    </tr>
                                </table>
                                <br />
                                <asp:GridView ID="gvViewRequisitionItems" runat="server" AutoGenerateColumns="False">
                                    <RowStyle HorizontalAlign="Right" VerticalAlign="Middle" />
                                    <Columns>
                                        <asp:BoundField DataField="ItemID" HeaderText="ID" />
                                        <asp:BoundField DataField="ItemName" HeaderText="Item Name" />
                                        <asp:BoundField DataField="SubUnitName" HeaderText="Requesting Store" />
                                        <asp:BoundField DataField="RequisitionQty" HeaderText="Ordered" />
                                        <asp:BoundField DataField="ReceivedQty" HeaderText="Received" />
                                        <asp:BoundField DataField="Denied" HeaderText="Denied" />
                                        <asp:TemplateField HeaderText="Status">
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblItemStatus" Text='<%# Bind("StatusName") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="TotalQuantity" HeaderText="Total Qty" Visible="False" />
                                    </Columns>
                                </asp:GridView>
                                <br />
                                <br />
                                <fieldset>
                                    <legend>Signature</legend>
                                    <table>
                                        <tr>
                                            <td class="style17">
                                                <asp:Label ID="lblGMSig" runat="server" Text="GM Signature:"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:Label ID="lblGMSigned" runat="server"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style17">
                                                <asp:Label ID="lblCEOSig" runat="server" Text="CEO Signature:"></asp:Label>
                                            </td>
                                            <td>
                                                <asp:Label ID="lblCEOSigned" runat="server"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                <input type="button" onclick="CEO_NewWindow();"
                                                    value="Generate CEO Signature Report" runat="server"
                                                    id="btnCEOReceipt" /></td>
                                        </tr>
                                        <tr>
                                            <td class="style17">&nbsp;</td>
                                            <td>
                                                <asp:Button ID="btnReceivedAdviceLog" runat="server"
                                                    OnClick="btnReceivedAdviceLog_Click" Text="Received Advice Log" />
                                            </td>
                                        </tr>
                                    </table>
                                </fieldset>
                            </asp:View>
                        </asp:MultiView>
                        <br />

                    </ContentTemplate>
                </asp:TabPanel>
                <asp:TabPanel ID="ViewRequests" runat="server" HeaderText="TabPanel2">
                    <HeaderTemplate>
                        View Requests
                    </HeaderTemplate>
                    <ContentTemplate>
                        <asp:MultiView ID="mvViewRequest" runat="server" ActiveViewIndex="0">
                            <asp:View ID="vViewRequest" runat="server">

                                <asp:Label ID="lblViewRequestEmpty" runat="server"></asp:Label>
                                <br />

                                <asp:GridView ID="gvRequests" runat="server" AutoGenerateColumns="False"
                                    OnRowCommand="gvRequests_RowCommand">
                                    <RowStyle HorizontalAlign="Right" VerticalAlign="Middle" />
                                    <Columns>
                                        <asp:BoundField DataField="SatelliteStoreRequestID" HeaderText="ID" />
                                        <asp:BoundField DataField="RequestDescription" HeaderText="Description" />
                                        <asp:BoundField DataField="StoreName" HeaderText="Store" />
                                        <asp:BoundField DataField="RequestDate" HeaderText="Date" />
                                        <asp:CommandField ButtonType="Button" ShowSelectButton="True" />
                                    </Columns>
                                </asp:GridView>
                            </asp:View>
                            <asp:View ID="vViewRequestItems" runat="server">
                                <table style="width: 100%;">
                                    <tr>
                                        <td class="style15"
                                            style="border-width: thin; border-style: solid; border-color: Black;">
                                            <strong>ID:</strong>
                                            <asp:Label ID="lblViewRequestID" runat="server"></asp:Label>
                                        </td>
                                        <td style="border-width: thin; border-style: solid; border-color: Black;"
                                            class="style23">
                                            <strong>Requested Date:</strong>
                                            <asp:Label ID="lblViewRequestDate" runat="server"></asp:Label>
                                        </td>
                                        <td style="border-width: thin; border-style: solid; border-color: Black;">
                                            <strong>Store Name:</strong>
                                            <asp:Label ID="lblRequestStoreName" runat="server"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="4"
                                            style="border-width: thin; border-style: solid; border-color: Black;">
                                            <strong>Description:</strong>
                                            <asp:Label ID="lblViewRequestDescription" runat="server"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="txtboxWidth"
                                            style="border-width: thin; border-style: solid; border-color: Black;"
                                            colspan="4">
                                            <asp:Button ID="btnNewRequest" runat="server" OnClick="btnNewRequest_Click"
                                                Text="Select New Request" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="center" colspan="4" class="style26">
                                            <asp:Label ID="lblViewRequestError" runat="server" ForeColor="Red"></asp:Label>
                                            &nbsp;&nbsp;
                                                    <asp:Button ID="btnYesApproval" runat="server" Text="Yes" Visible="False"
                                                        OnClick="btnYesApproval_Click" />
                                            &nbsp;&nbsp;
                                                    <asp:Button ID="btnNoApproval" runat="server" Text="No"
                                                        OnClick="btnNoApproval_Click" Visible="False" />
                                        </td>
                                    </tr>
                                </table>
                                <br />
                                <br />
                                <asp:GridView ID="gvRequestItems" runat="server" AutoGenerateColumns="False"
                                    OnRowCommand="gvRequestItems_RowCommand"
                                    OnRowDataBound="gvRequestItems_RowDataBound"
                                    OnDataBound="gvRequestItems_DataBound">
                                    <RowStyle HorizontalAlign="Right" VerticalAlign="Middle" />
                                    <Columns>
                                        <%--<asp:BoundField DataField="ItemID" HeaderText="No." />
                                                <asp:BoundField DataField="ItemName" HeaderText="Item Name" />--%>
                                        <asp:TemplateField HeaderText="Item Name">
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblItemName" Text='<%# Eval("ItemName") %>'></asp:Label>
                                                <asp:Label runat="server" ID="lblItemID" Text='<%# Eval("ItemID") %>' Visible="false"></asp:Label>
                                                <asp:Label runat="server" ID="lblRequestItemID" Text='<%# Eval("StoreRequestItemID") %>' Visible="false"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="QtyRequested" HeaderText="Requested Qty">
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                        </asp:BoundField>

                                        <asp:BoundField HeaderText="Emergency Qty" DataField="EmergencyQty">
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                        </asp:BoundField>

                                        <asp:BoundField DataField="TotalQuantity" HeaderText="Available Qty">
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                        </asp:BoundField>

                                        <asp:TemplateField HeaderText="Amount Approved">
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblAmtApproved" Text='<%# GetAllocated(Eval("Allocated")) %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:TemplateField HeaderText="Status">
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblStatusName" Text='<%# Bind("StatusName") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Qty Approved">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="Textbox1" runat="server"></asp:TextBox>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtRequestAdd" runat="server" Height="23px" Width="40px"
                                                    MaxLength="4"></asp:TextBox>
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:ButtonField ButtonType="Button" CommandName="Requisition"
                                            Text="Add to Requisition" Visible="False" />
                                        <asp:ButtonField ButtonType="Button" CommandName="Reallocate"
                                            Text="Re-Allocate" Visible="False" />

                                        <%--<asp:ButtonField ButtonType="Button" CommandName="Ready" Text="Approve" />--%>
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                                <asp:Button runat="server" Text="Approve" ID="btnApprove" CommandName="Ready" CommandArgument='<%# Container.DataItemIndex %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:BoundField DataField="SatelliteStoreRequestID" HeaderText="ID"
                                            Visible="False" />
                                    </Columns>
                                </asp:GridView>
                                <br />
                            </asp:View>

                            <asp:View ID="View3" runat="server">
                                <asp:UpdatePanel ID="Reallocate" runat="server">
                                    <ContentTemplate>
                                        <table style="width: 100%;">
                                            <tr>
                                                <td class="style28" style="border-color: #000000; border-style: solid;">Item ID:
                                                    <asp:Label ID="lblItemID" runat="server"></asp:Label>
                                                </td>
                                                <td class="style27" style="border-color: #000000; border-style: solid;">Item Name:
                                                    <asp:Label ID="lblItemN" runat="server"></asp:Label>
                                                </td>
                                                <td>&nbsp;</td>
                                            </tr>
                                            <tr>
                                                <td class="style28" style="border-color: #000000; border-style: solid;">SubUnitID:
                                                    <asp:Label ID="lblStoreNumber" runat="server"></asp:Label>
                                                </td>
                                                <td class="style27" style="border-color: #000000; border-style: solid;">Quantities Below</td>
                                                <td>&nbsp;</td>
                                            </tr>
                                            <tr>
                                                <td class="style28" style="border-color: #000000; border-style: solid;">

                                                    <asp:Label ID="lblStoreName" runat="server"></asp:Label>

                                                </td>
                                                <td class="style27" style="border-color: #000000; border-style: solid;">
                                                    <asp:Label ID="lblStoreQty" runat="server"></asp:Label>
                                                </td>
                                                <td>&nbsp;</td>
                                            </tr>
                                            <tr>
                                                <td class="style28" style="border-color: #000000; border-style: solid;">
                                                    <asp:DropDownList ID="ddlTransferFromStore" runat="server" AutoPostBack="True"
                                                        OnSelectedIndexChanged="ddlTransferFromStore_SelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </td>
                                                <td class="style27" style="border-color: #000000; border-style: solid;">
                                                    <asp:Label ID="lblTransferFromQty" runat="server"></asp:Label>
                                                </td>
                                                <td>
                                                    <asp:Label ID="lblReallocateError" runat="server" ForeColor="Red"></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="style28" style="border-color: #000000; border-style: solid;">
                                                    <asp:Label ID="lblTransferQty" runat="server" Text="Reallocate Amount:"></asp:Label>
                                                </td>
                                                <td class="style27" style="border-color: #000000; border-style: solid;">
                                                    <asp:TextBox ID="txtTransferQty" runat="server"></asp:TextBox>
                                                </td>
                                                <td>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
                                                        ControlToValidate="txtTransferQty" ErrorMessage="Must enter an amount"
                                                        ForeColor="Red" ValidationGroup="Reallocate"></asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="style28" style="border-color: #000000; border-style: solid;">
                                                    <asp:Button ID="btnReturn" runat="server" OnClick="btnReturn_Click"
                                                        Text="Return" />
                                                </td>
                                                <td class="style27" style="border-color: #000000; border-style: solid;">
                                                    <asp:Button ID="btnReallocate" runat="server" Text="Reallocate"
                                                        OnClick="btnReallocate_Click" ValidationGroup="Reallocate" />
                                                </td>
                                                <td>
                                                    <asp:CompareValidator ID="CompareValidator1" runat="server"
                                                        ControlToValidate="txtTransferQty" ErrorMessage="Must be a number"
                                                        ForeColor="Red" Operator="DataTypeCheck" Type="Integer"
                                                        ValidationGroup="Reallocate"></asp:CompareValidator>
                                                </td>
                                            </tr>
                                        </table>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </asp:View>

                            <asp:View ID="CreateReqName" runat="server">
                                <table style="width: 100%;">
                                    <tr>
                                        <td class="style25">
                                            <asp:Label ID="lblDescription2" runat="server" Text="Description:"></asp:Label>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtDescription2" runat="server" Height="21px" Width="497px"></asp:TextBox>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
                                                ControlToValidate="txtDescription2" ErrorMessage="Description is Required"
                                                ForeColor="Red" ValidationGroup="Description2"></asp:RequiredFieldValidator>
                                        </td>
                                        <td>&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td class="style25">
                                            <asp:Button ID="btnBack" runat="server" OnClick="btnBack_Click" Text="Back" />
                                        </td>
                                        <td>
                                            <asp:Button ID="btnCreate2" runat="server" OnClick="btnCreate2_Click"
                                                Text="Create" ValidationGroup="Description2" />
                                        </td>
                                        <td>&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td class="style25">&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                    </tr>
                                </table>
                            </asp:View>
                        </asp:MultiView>

                    </ContentTemplate>
                </asp:TabPanel>

                <asp:TabPanel ID="CreateRequisition" runat="server" HeaderText="TabPanel3">
                    <HeaderTemplate>Create Requisition</HeaderTemplate>
                    <ContentTemplate>
                        <asp:MultiView ID="mvRequest" runat="server" ActiveViewIndex="0">
                            <asp:View ID="vCreateRequest" runat="server">
                                <asp:Button ID="btnCreateRequest" runat="server"
                                    Text="Create Requisition" OnClick="btnCreateRequest_Click"
                                    ValidationGroup="Create" />
                                <asp:Button ID="btnCreateOutsideProcure" runat="server"
                                    Text="Create Outside Procurement" OnClick="btnCreateOutsideProcure_Click" />
                            </asp:View>
                            <asp:View ID="vAddItemRequest" runat="server">
                                <br />
                                <fieldset id="field1" style="width: 100%;">
                                    <table id="CreateRequest1" style="width: 100%;">
                                        <tr>
                                            <td style="vertical-align: top;">
                                                <table>
                                                    <tr>
                                                        <th>
                                                            <asp:Label ID="lblItemCategory" runat="server" Text="Item Category:" CssClass="labels"></asp:Label></th>
                                                        <td>
                                                            <asp:DropDownList ID="ddlItemCategory" runat="server" AutoPostBack="True"></asp:DropDownList></td>
                                                    </tr>
                                                    <tr>
                                                        <td></td>
                                                        <td>
                                                            <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="Search by Category" /></td>
                                                    </tr>
                                                    <tr>
                                                        <th>
                                                            <asp:Label ID="lblItemName" runat="server" Text="Item Name:" CssClass="labels"></asp:Label></th>
                                                        <td>
                                                            <asp:TextBox ID="txtItemName" runat="server" MaxLength="99"></asp:TextBox></td>
                                                    </tr>
                                                    <tr>
                                                        <td></td>
                                                        <td>
                                                            <asp:Button ID="btnSearchItemName" runat="server" OnClick="btnSearchItemName_Click" Text="Search for Item" /></td>
                                                    </tr>
                                                    <%--<tr>
                                                                <th><asp:Label ID="lblOrderFor" runat="server" Text="Order For:" CssClass="labels"></asp:Label></th>
                                                                <td><asp:DropDownList ID="ddlSubUnit" runat="server"></asp:DropDownList></td>
                                                            </tr>--%>
                                                    <tr>
                                                        <td colspan="2">
                                                            <asp:Label ID="lblMyError" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label></td>
                                                    </tr>
                                                </table>
                                            </td>
                                            <td>
                                                <asp:GridView ID="gvItemSearch" runat="server" AllowPaging="True"
                                                    AutoGenerateColumns="False" AllowSorting="True"
                                                    OnPageIndexChanging="gvItemSearch_PageIndexChanging" PageSize="5"
                                                    Width="50%" OnRowCommand="gvItemSearch_RowCommand" OnSorting="gvItemSearch_Sorting">
                                                    <RowStyle HorizontalAlign="Right" VerticalAlign="Middle" />
                                                    <Columns>
                                                        <%--<asp:BoundField DataField="itemID" HeaderText="No." />--%>
                                                        <asp:BoundField DataField="itemName" HeaderText="Item Name" SortExpression="itemName" />
                                                        <asp:TemplateField ConvertEmptyStringToNull="False" HeaderText="Qty.">
                                                            <EditItemTemplate>
                                                                <asp:Label runat="server" Visible="false" ID="lblItemID" Text='<%# Eval("itemID") %>'></asp:Label>
                                                                <asp:DynamicControl ID="DynamicControl1" runat="server" DataField=""
                                                                    Mode="Edit" />
                                                            </EditItemTemplate>
                                                            <ItemTemplate>
                                                                <asp:Label runat="server" Visible="false" ID="lblItemID" Text='<%# Eval("itemID") %>'></asp:Label>
                                                                <asp:TextBox ID="txtQuantity" runat="server" Height="25px" Width="36px"
                                                                    MaxLength="5"></asp:TextBox>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:ButtonField ButtonType="Button" CommandName="Add" Text="Add" />
                                                    </Columns>
                                                    <PagerTemplate>
                                                        <table style="width: 265px">
                                                            <tr>
                                                                <td>
                                                                    <asp:LinkButton ID="lnkFirstPage" runat="server" CommandArgument="First"
                                                                        CommandName="Page">[First]</asp:LinkButton>
                                                                </td>
                                                                <td class="style11">
                                                                    <asp:LinkButton ID="lnkPrevPage" runat="server" CommandArgument="Prev"
                                                                        CommandName="Page">[Previous]</asp:LinkButton>
                                                                </td>
                                                                <td>
                                                                    <asp:LinkButton ID="lnkNextPage" runat="server" CommandArgument="Next"
                                                                        CommandName="Page">[Next]</asp:LinkButton>
                                                                </td>
                                                                <td>
                                                                    <asp:LinkButton ID="lnkLastPage" runat="server" CommandArgument="Last"
                                                                        CommandName="Page">[Last]</asp:LinkButton>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </PagerTemplate>
                                                </asp:GridView>
                                            </td>
                                        </tr>
                                    </table>
                                </fieldset>

                                <fieldset style="width: 100%;">
                                    <table id="createrequest2" style="width: 100%;">
                                        <tr>
                                            <td class="style29"
                                                style="border-width: thin; border-style: solid; border-color: Black;">
                                                <strong>Requisition ID:</strong>
                                                <asp:Label ID="lblRequisitionID" runat="server"></asp:Label>
                                            </td>
                                            <td class="style2" style="border-width: thin; border-style: solid; border-color: Black;">
                                                <strong>Date:</strong>
                                                <asp:Label ID="lblRequisitionDate" runat="server"></asp:Label>
                                            </td>
                                        </tr>
                                        <%--<tr>
                                                    <td colspan="2" 
                                                        style="border-width:thin; border-style:solid; border-color:Black;">
                                                        <strong>Description:</strong>
                                                        <asp:Label ID="lblDescription" runat="server"></asp:Label>
                                                    </td>
                                                </tr>--%>
                                        <tr>
                                            <td align="center" class="style29" colspan="1">
                                                <strong>
                                                    <asp:Label ID="lblEnteredDescription" runat="server"
                                                        Text="Requisition Description:"></asp:Label></strong>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtDescription" runat="server" Height="26px"
                                                    ValidationGroup="Create" Width="488px"></asp:TextBox>
                                                <asp:Label ID="lblAstrisk" runat="server" Text="*" ForeColor="Red"
                                                    Visible="False"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center" colspan="2">
                                                <asp:Label ID="lblDescriptionError" runat="server" ForeColor="Red"
                                                    Visible="False"></asp:Label>
                                                <br />
                                                <asp:Label ID="lblRequestMissing" runat="server" ForeColor="Red"></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                    <br />
                                    <asp:GridView ID="gvRequisition" runat="server" AutoGenerateColumns="False"
                                        OnRowCommand="gvRequisition_RowCommand" OnRowEditing="gvRequisition_RowEditing"
                                        OnRowCancelingEdit="gvRequisition_RowCancelingEdit" OnRowUpdating="gvRequisition_RowUpdating">
                                        <RowStyle HorizontalAlign="Right" VerticalAlign="Middle" />
                                        <Columns>
                                            <%--<asp:BoundField DataField="ItemID" HeaderText="Item No." ReadOnly="True" />
                                                    <asp:BoundField DataField="ItemName" HeaderText="Item Name"  ReadOnly="True" />--%>
                                            <asp:TemplateField HeaderText="Item Name">
                                                <ItemTemplate>
                                                    <asp:Label runat="server" ID="lblItemName" Text='<%# Eval("ItemName") %>'></asp:Label>
                                                    <asp:Label runat="server" ID="lblItemID" Text='<%# Eval("ItemID") %>' Visible="false"></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Qty">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="txtEditRequisitionQty" MaxLength="5" Width="65px" runat="server" Text='<%# Bind("RequisitionQty") %>'></asp:TextBox>
                                                    <asp:Label Text='<%# Eval("SubUnitID") %>' runat="server" ID="lblStoreID" Visible="false" />
                                                    <asp:CompareValidator runat="server" ID="cmvEditRequisitionQty" ControlToValidate="txtEditRequisitionQty"
                                                        ErrorMessage="Must be a number greater than 0" Type="Integer" Operator="GreaterThan" ValidationGroup="edit"
                                                        ForeColor="Red" SetFocusOnError="true" Display="Dynamic" ValueToCompare="0"></asp:CompareValidator>
                                                    <asp:RequiredFieldValidator runat="server" ID="rfvEditRequisitionQty" ControlToValidate="txtEditRequisitionQty"
                                                        ForeColor="Red" ErrorMessage="Required" Display="Dynamic" SetFocusOnError="true" ValidationGroup="edit">
                                                    </asp:RequiredFieldValidator>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label runat="server" ID="lblRequisitonQty" Text='<%# Bind("RequisitionQty") %>'></asp:Label>
                                                    <asp:Label Text='<%# Eval("SubUnitID") %>' runat="server" ID="lblStoreID" Visible="false" />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:CommandField ButtonType="Button" ShowEditButton="True" ValidationGroup="edit" />
                                            <asp:ButtonField ButtonType="Button" CommandName="Remove" Text="Delete" />
                                        </Columns>
                                    </asp:GridView>
                                    <br />
                                    <asp:Button ID="btnSubmitRequisition" runat="server" Text="Submit Requisition"
                                        OnClick="btnSubmitRequisition_Click" />
                                    &nbsp;&nbsp;&nbsp;
                                            <asp:Button ID="btnCancel" runat="server" Text="Cancel"
                                                OnClick="btnCancel_Click" />
                                </fieldset>

                            </asp:View>

                            <asp:View runat="server" ID="vwOutsideProcurement">
                                <%--This is where the new procure stuff happens.--%>
                                <fieldset id="fsOutside" style="width: 100%;">
                                    <table id="tblOutside" style="width: 100%;">
                                        <tr>
                                            <td style="vertical-align: top;">
                                                <table>
                                                    <tr>
                                                        <th>
                                                            <asp:Label runat="server" ID="lblOutsideID" Visible="false"></asp:Label>
                                                            <asp:Label ID="lblOutsideItemCategory" runat="server" Text="Item Category:" CssClass="labels"></asp:Label></th>
                                                        <td>
                                                            <asp:DropDownList ID="ddlOutsideItemCategory" runat="server" AutoPostBack="True"></asp:DropDownList></td>
                                                    </tr>
                                                    <tr>
                                                        <td></td>
                                                        <td>
                                                            <asp:Button ID="btnOutsideCategorySearch" runat="server" OnClick="btnOutsideCategorySearch_Click" Text="Search by Category" /></td>
                                                    </tr>
                                                    <tr>
                                                        <th>
                                                            <asp:Label ID="lblOutsideItemName" runat="server" Text="Item Name:" CssClass="labels"></asp:Label></th>
                                                        <td>
                                                            <asp:TextBox ID="txtOutsideItemName" runat="server" MaxLength="99"></asp:TextBox></td>
                                                    </tr>
                                                    <tr>
                                                        <td></td>
                                                        <td>
                                                            <asp:Button ID="btnOutsideSearchItemName" runat="server" OnClick="btnOutsideSearchItemName_Click" Text="Search for Item" /></td>
                                                    </tr>
                                                    <%--<tr>
                                                                <th><asp:Label ID="lblOrderFor" runat="server" Text="Order For:" CssClass="labels"></asp:Label></th>
                                                                <td><asp:DropDownList ID="ddlSubUnit" runat="server"></asp:DropDownList></td>
                                                            </tr>--%>
                                                    <tr>
                                                        <td colspan="2">
                                                            <asp:Label ID="lblOutsideMyError" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label></td>
                                                    </tr>
                                                </table>
                                            </td>
                                            <td>
                                                <asp:GridView ID="gvOutsideItemSearch" runat="server" AllowPaging="True"
                                                    AutoGenerateColumns="False" AllowSorting="True"
                                                    OnPageIndexChanging="gvOutsideItemSearch_PageIndexChanging" PageSize="5"
                                                    Width="50%" OnRowCommand="gvOutsideItemSearch_RowCommand" OnSorting="gvOutsideItemSearch_Sorting">
                                                    <RowStyle HorizontalAlign="Right" VerticalAlign="Middle" />
                                                    <Columns>
                                                        <%--<asp:BoundField DataField="itemID" HeaderText="No." />--%>
                                                        <asp:BoundField DataField="itemName" HeaderText="Item Name" SortExpression="itemName" />
                                                        <asp:TemplateField ConvertEmptyStringToNull="False" HeaderText="Qty.">
                                                            <EditItemTemplate>
                                                                <asp:Label runat="server" Visible="false" ID="lblItemID" Text='<%# Eval("itemID") %>'></asp:Label>
                                                                <asp:DynamicControl ID="DynamicControl1" runat="server" DataField=""
                                                                    Mode="Edit" />
                                                            </EditItemTemplate>
                                                            <ItemTemplate>
                                                                <asp:Label runat="server" Visible="false" ID="lblItemID" Text='<%# Eval("itemID") %>'></asp:Label>
                                                                <asp:TextBox ID="txtQuantity" runat="server" Height="25px" Width="36px"
                                                                    MaxLength="5"></asp:TextBox>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:ButtonField ButtonType="Button" CommandName="Add" Text="Add" />
                                                    </Columns>
                                                    <PagerTemplate>
                                                        <table style="width: 265px">
                                                            <tr>
                                                                <td>
                                                                    <asp:LinkButton ID="lnkFirstPage" runat="server" CommandArgument="First"
                                                                        CommandName="Page">[First]</asp:LinkButton>
                                                                </td>
                                                                <td class="style11">
                                                                    <asp:LinkButton ID="lnkPrevPage" runat="server" CommandArgument="Prev"
                                                                        CommandName="Page">[Previous]</asp:LinkButton>
                                                                </td>
                                                                <td>
                                                                    <asp:LinkButton ID="lnkNextPage" runat="server" CommandArgument="Next"
                                                                        CommandName="Page">[Next]</asp:LinkButton>
                                                                </td>
                                                                <td>
                                                                    <asp:LinkButton ID="lnkLastPage" runat="server" CommandArgument="Last"
                                                                        CommandName="Page">[Last]</asp:LinkButton>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </PagerTemplate>
                                                </asp:GridView>
                                            </td>
                                        </tr>
                                    </table>
                                </fieldset>

                                <fieldset style="width: 100%;">
                                    <table id="tblOutside2" style="width: 100%;">
                                        <tr>
                                            <td>
                                                <strong>Procurement Vendor:</strong>
                                            </td>
                                            <td>
                                                <asp:DropDownList runat="server" ID="ddlOutsideVendor">
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                        <%--<tr>
                                                    <td colspan="2" 
                                                        style="border-width:thin; border-style:solid; border-color:Black;">
                                                        <strong>Description:</strong>
                                                        <asp:Label ID="lblDescription" runat="server"></asp:Label>
                                                    </td>
                                                </tr>--%>
                                        <tr>
                                            <td align="center" class="style29" colspan="1">
                                                <strong>
                                                    Order ID:
                                                </strong>
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtOutsideOrderID" runat="server" Height="26px" MaxLength="50"
                                                    ValidationGroup="Outside" Width="150px"></asp:TextBox>
                                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ErrorMessage="*" ControlToValidate="txtOutsideOrderID"
                                                    runat="server" ForeColor="Red" ValidationGroup="Outside" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td align="center" colspan="2">
                                                <asp:Label ID="lblOutsideOrderIDError" runat="server" ForeColor="Red"
                                                    Visible="False"></asp:Label>
                                                <br />
                                                <asp:Label ID="lblOutsideRequestMissing" runat="server" ForeColor="Red"></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                    <br />
                                    <asp:GridView ID="gvOutsideRequisition" runat="server" AutoGenerateColumns="False"
                                        OnRowCommand="gvOutsideRequisition_RowCommand" OnRowEditing="gvOutsideRequisition_RowEditing"
                                        OnRowCancelingEdit="gvOutsideRequisition_RowCancelingEdit" OnRowUpdating="gvOutsideRequisition_RowUpdating">
                                        <RowStyle HorizontalAlign="Right" VerticalAlign="Middle" />
                                        <Columns>
                                            <%--<asp:BoundField DataField="ItemID" HeaderText="Item No." ReadOnly="True" />
                                                    <asp:BoundField DataField="ItemName" HeaderText="Item Name"  ReadOnly="True" />--%>
                                            <asp:TemplateField HeaderText="Item Name">
                                                <ItemTemplate>
                                                    <asp:Label runat="server" ID="lblItemName" Text='<%# Eval("ItemName") %>'></asp:Label>
                                                    <asp:Label runat="server" ID="lblItemID" Text='<%# Eval("ItemID") %>' Visible="false"></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Qty">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="txtEditRequisitionQty" MaxLength="5" Width="65px" runat="server" Text='<%# Bind("RequisitionQty") %>'></asp:TextBox>
                                                    <asp:Label Text='<%# Eval("SubUnitID") %>' runat="server" ID="lblStoreID" Visible="false" />
                                                    <asp:CompareValidator runat="server" ID="cmvEditRequisitionQty" ControlToValidate="txtEditRequisitionQty"
                                                        ErrorMessage="Must be a number greater than 0" Type="Integer" Operator="GreaterThan" ValidationGroup="edit"
                                                        ForeColor="Red" SetFocusOnError="true" Display="Dynamic" ValueToCompare="0"></asp:CompareValidator>
                                                    <asp:RequiredFieldValidator runat="server" ID="rfvEditRequisitionQty" ControlToValidate="txtEditRequisitionQty"
                                                        ForeColor="Red" ErrorMessage="Required" Display="Dynamic" SetFocusOnError="true" ValidationGroup="edit">
                                                    </asp:RequiredFieldValidator>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label runat="server" ID="lblRequisitonQty" Text='<%# Bind("RequisitionQty") %>'></asp:Label>
                                                    <asp:Label Text='<%# Eval("SubUnitID") %>' runat="server" ID="lblStoreID" Visible="false" />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:CommandField ButtonType="Button" ShowEditButton="True" ValidationGroup="edit" />
                                            <asp:ButtonField ButtonType="Button" CommandName="Remove" Text="Delete" />
                                        </Columns>
                                    </asp:GridView>
                                    <br />
                                    <asp:Button ID="btnSubmitOutsideProcure" runat="server" Text="Submit Procurement"
                                        OnClick="btnSubmitOutsideProcure_Click" ValidationGroup="Outside" />
                                    &nbsp;&nbsp;&nbsp;
                                            <asp:Button ID="btnCancelOutsideProcure" runat="server" Text="Cancel"
                                                OnClick="btnCancelOutsideProcure_Click" />
                                </fieldset>
                            </asp:View>

                        </asp:MultiView>
                    </ContentTemplate>
                </asp:TabPanel>

                <asp:TabPanel ID="AllocateItems" runat="server" HeaderText="TabPanel4">
                    <HeaderTemplate>Fill Request</HeaderTemplate>
                    <ContentTemplate>
                        <asp:MultiView ID="mvRequestFill" runat="server" ActiveViewIndex="0">
                            <asp:View ID="View5" runat="server">
                                <asp:Label ID="lblErrorFillRequest" runat="server"></asp:Label>
                                <br />
                                <asp:GridView ID="gvRequestFill" runat="server" AutoGenerateColumns="False"
                                    OnRowCommand="gvRequestFill_RowCommand">
                                    <RowStyle HorizontalAlign="Right" VerticalAlign="Middle" />
                                    <Columns>
                                        <asp:BoundField DataField="SatelliteStoreRequestID" HeaderText="ID" />
                                        <asp:BoundField DataField="RequestDescription" HeaderText="Description" />
                                        <asp:BoundField DataField="StoreName" HeaderText="Store" />
                                        <asp:BoundField DataField="RequestDate" HeaderText="Date" />
                                        <asp:ButtonField ButtonType="Button" CommandName="Choose" Text="Select" />
                                    </Columns>
                                </asp:GridView>
                            </asp:View>
                            <asp:View ID="View4" runat="server">
                                <table style="width: 100%;">
                                    <tr>
                                        <td class="txtboxWidth"
                                            style="border-width: thin; border-style: solid; border-color: Black;">ID:
                                                    <asp:Label ID="lblFillRequestID" runat="server"></asp:Label>
                                        </td>
                                        <td style="border-width: thin; border-style: solid; border-color: Black;">Date:
                                                    <asp:Label ID="lblFillRequestDate" runat="server"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"
                                            style="border-width: thin; border-style: solid; border-color: Black;">Description:
                                                    <asp:Label ID="lblFillRequestDescription" runat="server"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="txtboxWidth" colspan="2"
                                            style="border-width: thin; border-style: solid; border-color: Black;">
                                            <asp:Button ID="btnNewFillRequest" runat="server" OnClick="btnNewFillRequest_Click"
                                                Text="Select New Request" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="center" colspan="2">
                                            <asp:Label ID="lblFillRequestError" ForeColor="Red" runat="server"></asp:Label>
                                        </td>
                                    </tr>
                                </table>
                                <br />
                                <asp:GridView ID="gvRequestFillItems" runat="server"
                                    AutoGenerateColumns="False" OnRowCommand="gvRequestFillItems_RowCommand"
                                    OnRowDataBound="gvRequestFillItems_RowDataBound">
                                    <RowStyle HorizontalAlign="Right" VerticalAlign="Middle" />
                                    <Columns>
                                        <%--<asp:BoundField DataField="ItemID" HeaderText="No." />
                                                <asp:BoundField DataField="ItemName" HeaderText="Item Name" />--%>
                                        <asp:TemplateField HeaderText="Item Name">
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblItemName" Text='<%# Eval("ItemName") %>'></asp:Label>
                                                <asp:Label runat="server" ID="lblItemID" Text='<%# Eval("ItemID") %>' Visible="false"></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="qtyRequested" HeaderText="Requested">
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                        </asp:BoundField>

                                        <asp:TemplateField HeaderText="Approved">
                                            <ItemTemplate>
                                                <asp:Label runat="server" ID="lblApproved" Text='<%# Eval("Allocated") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:TemplateField HeaderText="Qty to Fill">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtFill" runat="server" Height="23px" Width="37px"
                                                    MaxLength="4"></asp:TextBox>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:ButtonField ButtonType="Button" CommandName="Fill" Text="Fill" />
                                        <asp:BoundField DataField="Received" HeaderText="Qty Received"></asp:BoundField>
                                        <asp:BoundField DataField="Last Received" HeaderText="Last Received"
                                            NullDisplayText="Not Received" />
                                    </Columns>
                                </asp:GridView>
                            </asp:View>
                        </asp:MultiView>
                    </ContentTemplate>
                </asp:TabPanel>

                <asp:TabPanel ID="ItemAdjustment" runat="server" HeaderText="TabPanel4">
                    <HeaderTemplate>Item Adjustment</HeaderTemplate>
                    <ContentTemplate>
                        <asp:MultiView ID="mvItemAdjustment" runat="server" ActiveViewIndex="0">
                            <asp:View ID="AdjustItem" runat="server">

                                <table style="width: 700px;">
                                    <tr>
                                        <td>
                                            <asp:GridView ID="gvItemAdjustment" runat="server" AllowPaging="True"
                                                AutoGenerateColumns="False"
                                                OnPageIndexChanging="gvItemAdjustment_PageIndexChanging"
                                                OnRowCommand="gvItemAdjustment_RowCommand"
                                                OnRowDataBound="gvItemAdjustment_RowDataBound" PageSize="5">
                                                <RowStyle HorizontalAlign="Right" VerticalAlign="Middle" />
                                                <Columns>
                                                    <%--<asp:BoundField DataField="ItemID" HeaderText="No." />
                                                <asp:BoundField DataField="ItemName" HeaderText="Item Name" />--%>
                                                    <asp:TemplateField HeaderText="Item Name">
                                                        <ItemTemplate>
                                                            <asp:Label runat="server" ID="lblItemName" Text='<%# Eval("ItemName") %>'></asp:Label>
                                                            <asp:Label runat="server" ID="lblItemID" Text='<%# Eval("ItemID") %>' Visible="false"></asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:BoundField DataField="TotalQuantity" HeaderText="Qty">
                                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                    </asp:BoundField>
                                                    <asp:TemplateField HeaderText="Adjust">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:TextBox ID="txtAddQuantity" runat="server" Height="23px" Width="40px" MaxLength="5"></asp:TextBox>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:ButtonField ButtonType="Button" CommandName="Adjust" Text="Remove Qty." />
                                                    <asp:TemplateField HeaderText="Reason">
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
                                                        </EditItemTemplate>
                                                        <ItemTemplate>
                                                            <asp:DropDownList ID="ddlAdjusmentReason" runat="server">
                                                            </asp:DropDownList>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <PagerTemplate>
                                                    <table style="width: 265px">
                                                        <tr>
                                                            <td>
                                                                <asp:LinkButton ID="lnkFirstPage" runat="server" CommandArgument="First"
                                                                    CommandName="Page">[First]</asp:LinkButton>
                                                            </td>
                                                            <td class="style11">
                                                                <asp:LinkButton ID="lnkPrevPage" runat="server" CommandArgument="Prev"
                                                                    CommandName="Page">[Previous]</asp:LinkButton>
                                                            </td>
                                                            <td>
                                                                <asp:LinkButton ID="lnkNextPage" runat="server" CommandArgument="Next"
                                                                    CommandName="Page">[Next]</asp:LinkButton>
                                                            </td>
                                                            <td>
                                                                <asp:LinkButton ID="lnkLastPage" runat="server" CommandArgument="Last"
                                                                    CommandName="Page">[Last]</asp:LinkButton>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </PagerTemplate>
                                            </asp:GridView>
                                            <br />
                                            <asp:Label ID="lblErrorItemAdjustment" runat="server" ForeColor="Red"></asp:Label>
                                        </td>
                                    </tr>
                                </table>

                            </asp:View>
                            <asp:View ID="Adjust" runat="server">
                            </asp:View>
                        </asp:MultiView>
                    </ContentTemplate>
                </asp:TabPanel>

                <asp:TabPanel ID="Allocation" runat="server" HeaderText="TabPanel4">
                    <HeaderTemplate>Current Inventory</HeaderTemplate>
                    <ContentTemplate>
                        <fieldset style="width: 573px; min-height: 176px;">
                            <asp:Label ID="lblAllocationTabError" runat="server" ForeColor="Red"></asp:Label>
                            <br />
                            <asp:GridView ID="gvAllocation" runat="server" AutoGenerateColumns="False" AllowPaging="True" AllowSorting="true"
                                OnPageIndexChanging="gvAllocation_PageIndexChanging" PageSize="6" Width="100%" OnSorting="gvAllocation_Sorting">
                                <RowStyle HorizontalAlign="Right" VerticalAlign="Middle" />
                                <Columns>
                                    <%--<asp:BoundField DataField="ItemID" HeaderText="No." />--%>
                                    <asp:BoundField DataField="ItemName" HeaderText="Name" SortExpression="ItemName" />
                                    <asp:TemplateField HeaderText="Individual Value<br />GH¢">
                                        <ItemTemplate>
                                            <asp:Label runat="server" ID="lblIndivVal" Text='<%# Eval("MarkupCost", "{0:0.00}") %>'></asp:Label>
                                        </ItemTemplate>
                                    </asp:TemplateField>

                                    <%-- TODO fix this so that it can be uncommented, at least for the sake of the next boundfield below. --%>
                                    <%--<asp:TemplateField HeaderText="Total Value<br />GH¢">
                                        <ItemTemplate>
                                            <asp:Label runat="server" ID="lblTotalVal" 
						                        Text='<%# CalcCost(Eval("MarkupCost"), Eval("TotalQuantity")) %>'></asp:Label>
                                            </ItemTemplate>
                                    </asp:TemplateField>--%>

                                    <asp:BoundField DataField="TotalQuantity" HeaderText="Total Qty" SortExpression="TotalQuantity"></asp:BoundField>
                                    <%--<asp:TemplateField ConvertEmptyStringToNull="False">
                                        <EditItemTemplate>
                                            <asp:DynamicControl ID="DynamicControl1" runat="server" DataField="" Mode="Edit" />
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtFill" runat="server" Height="23px" Width="37px" MaxLength="5"></asp:TextBox>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:ButtonField ButtonType="Button" CommandName="Fill" Text="Add Qty." />
                                    <asp:BoundField DataField="Quantity" HeaderText="Emergency Qty" >
                                    </asp:BoundField>
                                    <asp:TemplateField>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:TextBox ID="txtAllocateEmergency" runat="server" Height="25px" 
                                                Width="39px"></asp:TextBox>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:ButtonField ButtonType="Button" CommandName="AllEmerg" 
                                        Text="Set Emergency" />--%>
                                </Columns>
                                <PagerTemplate>
                                    <table style="width: 265px">
                                        <tr>
                                            <td>
                                                <asp:LinkButton ID="lnkFirstPage" runat="server" CommandArgument="First"
                                                    CommandName="Page">[First]</asp:LinkButton>
                                            </td>
                                            <td class="style11">
                                                <asp:LinkButton ID="lnkPrevPage" runat="server" CommandArgument="Prev"
                                                    CommandName="Page">[Previous]</asp:LinkButton>
                                            </td>
                                            <td>
                                                <asp:LinkButton ID="lnkNextPage" runat="server" CommandArgument="Next"
                                                    CommandName="Page">[Next]</asp:LinkButton>
                                            </td>
                                            <td>
                                                <asp:LinkButton ID="lnkLastPage" runat="server" CommandArgument="Last"
                                                    CommandName="Page">[Last]</asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                </PagerTemplate>
                            </asp:GridView>
                            <br />
                        </fieldset>
                    </ContentTemplate>
                </asp:TabPanel>

            </asp:TabContainer>

        </ContentTemplate>
    </asp:UpdatePanel>

</asp:Content>
